{# Stalker Pyramid a Web Base Production Asset Management System
 Copyright (C) 2009-2014 Erkan Ozgur Yilmaz

 This file is part of Stalker Pyramid.

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation;
 version 2.1 of the License.

 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#}
{% extends "base.jinja2" %}

{# BREADCRUMBS #}
{% block breadcrumbs %}

    {% set page_title='Sequences' %}
    {% include 'breadcrumb/breadcrumbs.jinja2' %}

{% endblock breadcrumbs %}

{# SIDEBAR #}
{% block sidebar %}
    {% include 'sidebar.jinja2' %}
{% endblock sidebar %}

{# PAGE-CONTENT #}
{% block page_content %}

    {% set page_title='Sequences' %}
    {% include 'page_header.jinja2' %}

    {% set add_button_address= request.route_url("create_sequence_dialog", id=-1, _query={'project_id': entity.id, 'came_from':request.current_route_path() })  %}

    {% set list_item_type='Sequence' %}
    {% include 'components/data_table.jinja2' %}


{% endblock page_content %}

{# EXTRA-SCRIPTS #}
{% block extrascripts %}

     {% raw %}
    <script id="tmpl_itemThead" type="text/x-dot-template">

    <tr>
            <th>Thumbnail</th>
            <th>Name</th>
            <th>Description</th>
            <th>Completed</th>
            <th>Status</th>
            <th>Created By</th>
        </tr>
    </script>
    {% endraw %}

    {% raw %}
    <script id="tmpl_itemRow" type="text/x-dot-template">
        <tr>
            <td><img style='width:auto; height: 100px;'
                     class="img-thumbnail"
                     src="{{=it.thumbnail_full_path }}">
            </td>
            <td><a href='/sequences/{{=it.id}}/view'>{{=it.name}}</a>
            </td>
            <td>{{=it.description}}
            </td>
            <td>
                <div class="progress progress-success">
                    <div style="width:{{=it.percent_complete}}%"
                         class="bar">
                        <span class="pull-left">{{=it.percent_complete}}%</span>
                    </div>
                </div>
            </td>
            <td>
                <span class="label label-{{=it.status_color}}">{{=it.status}}</span>
            </td>
            <td><a href='/users/{{=it.created_by_id}}/view'>{{=it.created_by_name}}</a>
            </td>
        </tr>
    </script>
    {% endraw %}

    <script>

        var tableParameters = {}
        var sortingParameters = [[0, 'asc']]
        var tableDataAddress = '{{ request.route_path('get_project_sequences', id=entity.id) }}'

     console.log('tableDataAddress' + tableDataAddress)

    </script>



{% endblock extrascripts %}

